package com.woniuxy.session.configuration;

import io.lettuce.core.RedisClient;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: linKe
 * @Date: 2022/1/6 15:47
 * @FileName: RedissonConfiguration
 * @version: 1.0
 * @Description: Redisson配置类
 */
@Configuration
public class RedissonConfiguration {
    /**
     * RedissonClient 配置
     * @return  结果
     */
    @Bean
    public RedissonClient redissonClient(){
        Config config = new Config();
        config.useSingleServer().setAddress("redis://127.0.0.1:6379");
        return Redisson.create(config);
    }
}
